package com.gg.user.gguser.controller;

import com.gg.user.gguser.service.GgHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author yangxinlei
 * @date 2020/5/22
 */

@RestController
@RequestMapping("/ggHome")
public class GgHomeController {

    @Autowired
    private GgHomeService ggHomeService;


    /**
     * 上部信息
     * @param response
     * @param request
     * @return
     * @throws Exception
     */
    @PostMapping("getHomeTop")
    public Object getHomeTop(HttpServletResponse response, HttpServletRequest request)throws Exception{
        return ggHomeService.getHomeTop(response,request);
    }

    /**
     * 中间信息简介
     * @param response
     * @param request
     * @return
     * @throws Exception
     */
    @PostMapping("getHomeCountInformation")
    public Object getHomeCountInformation(HttpServletResponse response, HttpServletRequest request)throws Exception{
        return ggHomeService.getHomeCountInformation(response,request);
    }

    /**
     * 底部统计图
     */
    @PostMapping("getHomeBottomChart")
    public Object getHomeBottomChart(HttpServletResponse response, HttpServletRequest request)throws Exception{
        return ggHomeService.getHomeBottomChart(response,request);
    }
}
